package unit8.part2;

import javax.swing.*;
import java.awt.*;

public class JFrameTest {
    public static void main(String[] args) {
        JFrame jFrame = new JFrame("测试窗体");
        jFrame.setSize(500, 200);
        jFrame.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));// 设置布局管理器

        JMenuBar jMenuBar = new JMenuBar();
        jMenuBar.add(new JMenu("查看Helper"));
        jFrame.setJMenuBar(jMenuBar);// 设置菜单栏

        Container container = jFrame.getContentPane();
        container.setBackground(Color.YELLOW);

        jFrame.add(new JButton("按钮A"));
        JButton jButton = new JButton("按钮B");
        jFrame.add(jButton);
        jFrame.remove(jButton);

        jFrame.setVisible(true);
    }
}
